package databeans;

import helper.Formatter;

import java.util.Date;

public class FundHistory implements Comparable<FundHistory>  {

    private int fundID = -1;
    private Date priceDate = null;
    private long price;
    
    public FundHistory(){
        //nothing so exciting
    }
    
    public FundHistory(int fundID, Date priceDate, long price){
    	this.setFundID(fundID);
    	this.setPriceDate(priceDate);
    	this.setPrice(price);
    }

    public int getFundID() {
        return fundID;
    }

    public Date getPriceDate() {
        return priceDate;
    }

    public long getPrice() {
        
        return price;
        //return Double.parseDouble(Formatter.cashDf.format(price));
    }

    public void setFundID(int fundID) {
        this.fundID = fundID;
    }

    public void setPriceDate(Date priceDate) {
        this.priceDate = priceDate;
    }

    public void setPrice(long price) {
        //double setPrice = Double.parseDouble(Formatter.cashDf.format(price));
        this.price = price;
    }

	public int compareTo(FundHistory f) {
        // order by id
		int c = String.valueOf(fundID).compareTo(String.valueOf(f.fundID));
			
        if (c != 0){
            return c;
        }

        return String.valueOf(fundID).compareTo(String.valueOf(f.fundID));
    }
   
}
